package com.itheima.shuzu;

import java.util.Random;

public class Demo8 {
    public static void main(String[] args) {
        Random ran=new Random();
        int[] data=new int[7];
        for (int i = 0; i <6 ; i++) {
            int x=ran.nextInt(32)+1;
            for (int j = 0; j <i ; j++) {
                if(x==data[j]) {
                    j=0;
                    x=ran.nextInt(32)+1;
                    continue;
                }
            }
            data[i]=x;
        }
        int x=ran.nextInt(16)+1;
        data[6]=x;
        System.out.print("红色的球显示的数字是:");
        for (int i = 0; i < 6; i++) {
            System.out.print(data[i]+" ");
        }
        System.out.print("      ");
        System.out.println("蓝色的球显示的数字是:"+data[6]+" ");
    }
}
